package org.wikinews.en.wikinewsreader;

import android.content.Context;
import android.os.Bundle;
import android.preference.PreferenceActivity; // Needed to get make pref screen
import android.preference.PreferenceManager; // Needed to get preference values

public class Prefs extends PreferenceActivity {
   // Option names and default values
   private static final String OPT_DOWNLOADONDEMAND = "downloadondemand";
   private static final boolean OPT_DOWNLOADONDEMAND_DEF = false;

   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      addPreferencesFromResource(R.xml.settings); // Reads settings.xml
   }
   
   
   /** Get the current value of the Download-On-Demand option */
   public static boolean getDownloadondemand(Context context) {
      return PreferenceManager.getDefaultSharedPreferences(context)
            .getBoolean(OPT_DOWNLOADONDEMAND, OPT_DOWNLOADONDEMAND_DEF);
   }
      
}
